#pragma once

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <time.h>

#define DEFAULT_CAPACITY	8
#define LOAD_FACTOR      0.75

typedef int* K;//�ؼ���
typedef struct man* V;//����

// ����������
typedef struct entry 
{
    K key;
    V* val;
    struct entry* next;
} Entry;

typedef struct 
{
    Entry** table;    //ָ��̬�����ָ��
    int size;		  //�洢Ԫ�صĸ���
    int capacity;     //��̬����Ĵ�С
    uint32_t hashseed;//��ϣ�����������
} HashMap;

// API
HashMap* hashmap_create(void);
void hashmap_destroy(HashMap* map);
V* hashmap_put(HashMap* map, K key, V* val);
V* hashmap_get(HashMap* map, K key);
void hashmap_delete(HashMap* map, K key);